<template>
  <div class="c-bg-white c-pb30">
    <div class="c-pt28 c-ph80">
      <div class="c-pv8 c-textAlign-c c-br20 c-fs22 target-top">
        {{'已推荐'+total+'人'}}
      </div>
    </div>
    <div class="c-pl30 c-flex-row c-aligni-center" v-for="(item, index) in recommendList" :key="index">
      <img :src="$addXossFilter(item.headimgurl, require('../../../assets/defult_head.png'))" class="c-ww80 c-hh80 c-brp50 c-mr20 c-flex-shrink0" />
      <div class="c-flex-grow1 c-bd-b1-mgray c-flex-row c-justify-sb c-pv56 c-pr32">
        <span class="c-fs28 c-fc-xblack">{{item.nickname}}</span>
        <span class="c-fs24 c-fc-gray">{{item.recommendType==1?'已访问':item.recommendType==2?'已绑定':'已支付'}}</span>
      </div>
    </div>
    <loading-status-tem :noneInfo="'暂无结果'" :noData="noneShow"></loading-status-tem>
  </div>
</template>

<script>
  import { utilJs } from "@/utils/common.js";
  import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
  export default {
    name: "recommendList",
    components: {
      loadingStatusTem,
    },
    prop: {},
    data() {
      return {
        recommendList: [],
        relateId: '',
        total: 0,
        noneShow: false
      }
    },
    created() {
      utilJs.appShare(this);
    },
    methods: {
      //获取推荐记录
      getRecommendRecord() {
        let data = {relateId: this.relateId};
        utilJs.postMethod(global.apiurl + `activity/recommend/getShareUserList`, data,
          res => {
            this.recommendList = res.list;
            this.total = res.total;
            if (this.total == 0 && this.recommendList.length == 0) {
              this.noneShow = true;
            } else {
              this.noneShow = false;
            }
          })
      },
      //分享
      wechatShare: function () {
        utilJs.wechatConfig("", "", "", "", function () { });
      },
      //手机端分享
      appShare: function () {
        utilJs.appShareTrue("", "", "", "");
      }
    },
    activated() {
      setDocumentTitle("推荐记录");
      this.userInfo = '';
      this.relateId = this.$route.query.relateId;
      this.getRecommendRecord();
      this.wechatShare();
    },
    deactivated() {},
  }
</script>

<style scoped>
.target-top {
  background-color: rgb(255,246,249);
  color:#FE9901;
}

</style>
